//Sunday, November 15 2009
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

string months[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

class YearProgressbar
{
public:
	int daysInMonth(int m, int y) { if (m==2 && isLeap(y)) return 29; return days[m-1]; }
	int getMonth(string mon)
	{
		for(int i=0; i<12; i++)
			if(mon == months[i])
				return i+1;
		return 0;
	}
	bool isLeap(int y)
	{
		if (y%400==0)
			return true;
		if (y%100==0)
			return false;
		if (y%4==0)
			return true;
		return false;
	}
	int convertStringToInteger(string s)
	{
		stringstream ss(s);
		int number;
		ss >> number;
		return number;
	}
	double percentage(string currentDate)
	{
		string mon;
		string day;
		string year;
		string time;
		stringstream s(currentDate);
		s >> mon >> day >> year >> time;
		//sscanf(currentDate, "%s%s%s%s", mon, day, year, time);
		int m = getMonth(mon);
		int d = convertStringToInteger(day.substr(0,2));
		int y = convertStringToInteger(year);
		double timeInyear = 365.0;
		double timeelapse = 0.0;
		if(isLeap(y)) timeInyear += 1.0;

		for(int i=1; i<m; i++)
			timeelapse += 1.0 * daysInMonth(i, y);
		timeelapse += 1.0*d - 1;
		timeelapse += (10.0*(time[0]-'0')+(time[1]-'0')) / 24;
		timeelapse += (10.0*(time[3]-'0')+(time[4]-'0')) / 60 / 24;
		return 100.0 * timeelapse / timeInyear;
	}
};
